package com.beijing.student.action;

import java.util.Date;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractCommandController;

import com.beijing.student.pojo.Student;

public class EditStuUI extends AbstractCommandController {

	private Date date = new Date();
	
	public EditStuUI() {
		this.setCommandClass(Student.class);
	}

	@Override
	protected ModelAndView handle(HttpServletRequest request,HttpServletResponse response,
			Object object, BindException exception)	throws Exception {
		
		ModelAndView modelAndView = new ModelAndView();
		
		Student student = new Student("张三","南京");
		student.setBirthday(date);
		student.setAge(15);
		
		modelAndView.addObject("student", student);
		modelAndView.setViewName("student/editStuUI");
		return modelAndView;
	}

}